<include file="Public/min-header" />
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<div class="wrapper">
    <include file="Public/breadcrumb" />
    <section class="content">
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i> 审核分销商申请</h3>
                </div>
                <div class="panel-body ">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_tongyong" data-toggle="tab">申请信息</a></li>
                    </ul>
                    <form method="post" id="editForm">
                        <div class="tab-content">                 	  
                            <div class="tab-pane active" id="tab_tongyong">
                                <table class="table table-bordered">
                                    <tbody>
                                        <tr>
                                            <td>一级用户id</td>
                                            <td>
                                                <a href="{:U('Admin/user/detail',array('id'=>$apply[user_id]))}">{$apply.user_id}</a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>用户名</td>
                                            <td>
                                                {$apply.nickname|default="空"}
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>申请用户id</td>
                                            <td>
                                                <a href="{:U('Admin/user/detail',array('id'=>$apply[apply_id]))}">{$apply.apply_id}</a>
                                            </td>
                                        </tr>                               
                                        <tr>
                                            <td>申请用户名</td>
                                            <td>
                                                {$apply.apply_nickname|default="空"}
                                            </td>
                                        </tr>                                       
                                        <tr>
                                            <td>状态</td>
                                            <td>
                                    <if condition="$apply[status] eq 1">申请中</if>
                                    <if condition="$apply[status] eq 2">申请成功</if>
                                    <if condition="$apply[status] eq 3">申请失败</if>   
                                    </td>
                                    </tr>                                                                                   
                                    </tbody>                                
                                </table>
                            </div>                           
                        </div>              
                        <div class="pull-right">
                            <input type="hidden" name="id" value="{$apply.id}">
                            <input type="hidden" id="status" name="status" value="{$apply[status]}">
                            <if condition="in_array($apply[status],array(1,3))">
                                <button class="btn btn-primary" data-toggle="tooltip" type="button" onclick="passApply();">审核通过</button>
                            </if>                        
                            <if condition="$apply[status] eq 1">
                                <button class="btn btn-primary" data-toggle="tooltip" type="button" onclick="refuseApply();">审核不通过</button>
                            </if>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </section>
</div>
<script>
    // 确定申请
    function passApply() {
        $('#status').val('2');
        $('#editForm').submit();
    }
    // 拒绝申请    
    function refuseCash() {
        $('#status').val('3');
        $('#editForm').submit();
    }

</script>
</body>

</html>
